package com.yuliang.basic;

public class UserServiceImpl implements UserService{

//    private UserDao userDao = new UserDaoImpl();
    //采用工厂类创建userDao解耦合

//    private UserDao userDao = (UserDao) BeanFactory.getBean("userDao");
    private UserDao userDao;

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void login(String name, int age) {
        System.out.println(userDao.login(name, age));
    }

    public void register() {
        System.out.println(userDao.register());
    }

}
